Optimal. Leaf size=76 \[ \frac{b \tanh ^{-1}(\sin (e+f x))}{d f}-\frac{2 (b c-a d) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{d f \sqrt{c-d} \sqrt{c+d}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.12879, antiderivative size = 76, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {3998, 3770, 3831, 2659, 208} \[ \frac{b \tanh ^{-1}(\sin (e+f x))}{d f}-\frac{2 (b c-a d) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{d f \sqrt{c-d} \sqrt{c+d}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3998
Rule 3770
Rule 3831
Rule 2659
Rule 208
Rubi steps
\begin{align*} \int \frac{\sec (e+f x) (a+b \sec (e+f x))}{c+d \sec (e+f x)} \, dx &=\frac{b \int \sec (e+f x) \, dx}{d}+\frac{(-b c+a d) \int \frac{\sec (e+f x)}{c+d \sec (e+f x)} \, dx}{d}\\ &=\frac{b \tanh ^{-1}(\sin (e+f x))}{d f}-\frac{(b c-a d) \int \frac{1}{1+\frac{c \cos (e+f x)}{d}} \, dx}{d^2}\\ &=\frac{b \tanh ^{-1}(\sin (e+f x))}{d f}-\frac{(2 (b c-a d)) \operatorname{Subst}\left (\int \frac{1}{1+\frac{c}{d}+\left (1-\frac{c}{d}\right ) x^2} \, dx,x,\tan \left (\frac{1}{2} (e+f x)\right )\right )}{d^2 f}\\ &=\frac{b \tanh ^{-1}(\sin (e+f x))}{d f}-\frac{2 (b c-a d) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{\sqrt{c-d} d \sqrt{c+d} f}\\ \end{align*}
Mathematica [A] time = 0.208298, size = 112, normalized size = 1.47 \[ \frac{\frac{2 (b c-a d) \tanh ^{-1}\left (\frac{(d-c) \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c^2-d^2}}\right )}{\sqrt{c^2-d^2}}+b \left (\log \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )-\log \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )\right )}{d f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.058, size = 135, normalized size = 1.8 \begin{align*}{\frac{b}{fd}\ln \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) }-{\frac{b}{fd}\ln \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) -1 \right ) }+2\,{\frac{a}{f\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{\tan \left ( 1/2\,fx+e/2 \right ) \left ( c-d \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) }-2\,{\frac{bc}{fd\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{\tan \left ( 1/2\,fx+e/2 \right ) \left ( c-d \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.95888, size = 707, normalized size = 9.3 \begin{align*} \left [-\frac{{\left (b c - a d\right )} \sqrt{c^{2} - d^{2}} \log \left (\frac{2 \, c d \cos \left (f x + e\right ) -{\left (c^{2} - 2 \, d^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, \sqrt{c^{2} - d^{2}}{\left (d \cos \left (f x + e\right ) + c\right )} \sin \left (f x + e\right ) + 2 \, c^{2} - d^{2}}{c^{2} \cos \left (f x + e\right )^{2} + 2 \, c d \cos \left (f x + e\right ) + d^{2}}\right ) -{\left (b c^{2} - b d^{2}\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) +{\left (b c^{2} - b d^{2}\right )} \log \left (-\sin \left (f x + e\right ) + 1\right )}{2 \,{\left (c^{2} d - d^{3}\right )} f}, -\frac{2 \,{\left (b c - a d\right )} \sqrt{-c^{2} + d^{2}} \arctan \left (-\frac{\sqrt{-c^{2} + d^{2}}{\left (d \cos \left (f x + e\right ) + c\right )}}{{\left (c^{2} - d^{2}\right )} \sin \left (f x + e\right )}\right ) -{\left (b c^{2} - b d^{2}\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) +{\left (b c^{2} - b d^{2}\right )} \log \left (-\sin \left (f x + e\right ) + 1\right )}{2 \,{\left (c^{2} d - d^{3}\right )} f}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (a + b \sec{\left (e + f x \right )}\right ) \sec{\left (e + f x \right )}}{c + d \sec{\left (e + f x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.29107, size = 178, normalized size = 2.34 \begin{align*} \frac{\frac{b \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right )}{d} - \frac{b \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right )}{d} + \frac{2 \,{\left (\pi \left \lfloor \frac{f x + e}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (2 \, c - 2 \, d\right ) + \arctan \left (\frac{c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{\sqrt{-c^{2} + d^{2}}}\right )\right )}{\left (b c - a d\right )}}{\sqrt{-c^{2} + d^{2}} d}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]